<script setup lang="ts">
import { ref } from 'vue'

// 1. 简单的数据
const score = ref(100)
const changeScore = () => {
  score.value++
  console.log(score.value)
}

// 2. 复杂的数据
const person = ref({
  name: '不知火舞',
  age: 8
})
const changeAge = () => {
  person.value.age++
}

</script>

<template>
  <div>
    <div>成绩: {{ score }}</div>
    <button @click="changeScore">修改成绩</button>
    <div>{{ person }}</div>
    <button @click="changeAge">修改年龄</button>
  </div>
</template>

<style></style>
